import clsx from "clsx";
import Link from "@docusaurus/Link";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import Layout from "@theme/Layout";
import HomepageFeatures from "@site/src/components/HomepageFeatures";

import Heading from "@theme/Heading";
import styles from "./index.module.css";

function currentLLQ() {
  const ua = navigator.userAgent;
  const isIE = ua.indexOf("MSIE ") > -1; // IE 10及以下
  const isIE11 = ua.indexOf("Trident/") > -1 && ua.indexOf("rv:") > -1; // IE 11
  const isEdge = ua.indexOf("Edge/") > -1; // Edge浏览器

  if (isEdge) return { type: "IE" };
  if (isIE11 || isIE) {
    return { type: "IE" }; // 返回版本号
  }
}

function HomepageHeader() {
  const { siteConfig } = useDocusaurusContext();

  return (
    <header className={clsx("hero hero--primary", styles.heroBanner)}>
      <div className="container">
        <Heading as="h1" className="hero__title">
          {siteConfig.title}
        </Heading>
        <p className="hero__subtitle">{siteConfig.tagline}</p>
        <p className="hero__subtitle">
          ✔️请使用现代浏览器。如chrome、firefox浏览器、360浏览器极速模式
          <Link
            className="button button--secondary"
            style={{ marginLeft: 50 }}
            href="http://10.182.206.18:28082/soft/ChromeStandaloneSetup64.exe"
          >
            点击下载浏览器
          </Link>
          <br />
          ❌请勿使用IE浏览器，或IE内核的浏览器。如360浏览器的兼容模式等
        </p>
        <p className="hero__subtitle"></p>
        <div className={styles.buttons}>
          <Link
            className="button button--secondary button--lg"
            to="/docs/docs/intro"
          >
            其实你点左上角也可以
          </Link>
        </div>
      </div>
    </header>
  );
}

export default function Home() {
  const { siteConfig } = useDocusaurusContext();
  return (
    <Layout
      title={`Hello from ${siteConfig.title}`}
      description="Description will go into a meta tag in <head />"
    >
      <HomepageHeader />
      <main>
        <HomepageFeatures />
      </main>
    </Layout>
  );
}
